<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var str = 'good idea';
      var reg = /\s../gi;               // 正则对象
      console.log(str.match(reg));      // 匹配结果：[" id"]
    </script>
  </body>
</html>